package edu.uestc.canary.config;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;

/**
 * 发布订阅监听器 MessageListener
 */
public class ChatMessageListener implements MessageListener {
    @Override
    public void onMessage(Message message, byte[] pattern) {
        System.out.println("消息监听器监听到消息:" + new String(message.getBody()));
        System.out.println("监听的channel:" + new String(message.getChannel()));
        System.out.println("pattern:" + new String(pattern));
    }
}
